package com.jie.netty.callback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * 失败重传函数
 */
@Slf4j
@Component
public class ReturnCallbackService implements RabbitTemplate.ReturnCallback {

    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        log.info("消息："+message.toString());
        log.info("返回码："+replyCode);
        log.info("返回描述："+replyText);
        log.info("交换机："+exchange);
        log.info("路由key："+routingKey);
        //TODO 制定重传策略

    }
}

